// https://blog.csdn.net/weixin_39549936/article/details/111134783  学习vuex用法

// 用户数据模块
import http from '@/common/request/index'


const state = {
	token: uni.getStorageSync("token") || "",
}

const getters = {
	token: state => state.token,
}

const actions = {
	token(context, value) {
		// console.log("token:===============");
		// console.log(value);
	  context.commit('token',value)
	},

}

const mutations = {
	token(state, payload) {
		state.token = payload;
		uni.setStorageSync("token", payload);
	},
	
}


export default {
	state,
	mutations,
	actions,
	getters
}
